<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
        <title>Facelet Title</title>
        <link type="text/css" rel="stylesheet" href="theme3.css" />
    </h:head>
    <body>
        <center>
            <h:form id="cadast">
                <p:messages autoUpdate="true" closable="true"/>
                <h:panelGrid>
                    <p:panel header="Cadastrar Usuario">
                        <h:panelGrid columns="2" cellpadding="7">
                            <h:outputText value="Email: "/>
                            <p:inputText id="email" value="#{cadastro.cadastroCM.usuario.email}" required="true"/>
                            <h:outputText value="Nome: "/>
                            <p:inputText id="nome" value="#{cadastro.cadastroCM.usuario.nome}" required="true"/>
                            <h:outputText value="Curso: "/>
                            <p:inputText id="curso" value="#{cadastro.cadastroCM.usuario.curso}" required="true"/>
                            <h:outputLabel for="status" value="Status do Curso:" />
                            <h:selectOneMenu id="status" value="#{cadastro.status_curso}" required="true">
                                <f:selectItem itemLabel="Selecione" itemValue="" />
                                <f:selectItems value="#{cadastro.status}" />
                            </h:selectOneMenu>
                            <h:outputText value="Data de Conclusao: "/>
                            <p:inputMask id="conclusao" value="#{cadastro.cadastroCM.usuario.data_conclusao_curso}" mask="99/99/9999"/>

                            <h:outputText value="Senha: "/>
                            <p:password id="senha" value="#{cadastro.cadastroCM.credencial.senha}" required="true"/>
                            <h:outputText value="Repita a senha: "/>
                            <p:password id="senha2" value="#{cadastro.cadastroCM.credencial.senha2}" required="true"/>
                            <p:commandButton value="SALVAR" action="#{cadastro.cadastrar}" onclick="execute"/>
                            <p:commandButton value="LIMPAR" type="reset"/>
                            
                            <h:link outcome="index" value="HOME" />
                        </h:panelGrid>
                    </p:panel>
                </h:panelGrid>
            </h:form>
        </center>
    </body>
</html>
